home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / asm_subr.arc / FPINDIGT < prev    next >
Encoding:
Text File  |  1985-12-25  |  1.4 KB  |  48 lines

  1. ;-------------------------fpindigt routine begins--------------------------+
  2. ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
  3. ;         page : 83
  4. ;
  5. ; NAME FPINDIGT
  6. ; ROUTINE FOR SINGLE DECIMAL DIGIT TO FLOATING POINT
  7. ;
  8. ; FUNCTION: This routine places a single decimal digit in temporary
  9. ; binary floating point format.
  10. ;
  11. ; INPUT: Upon entry AL contains the value of the digit
  12. ;
  13. ; OUTPUT: Upon entry and exit the address of the temporary binary floating
  14. ; point result is in DI.
  15. ;
  16. ; REGISTERS USED:  AL,CX and DI are modified.
  17. ;
  18. ; SEGMENTS REFERENCED:  Upon entry the data segment contains storage for
  19. ; the temporary binary floating point number.
  20. ;
  21. ; ROUTINES CALLED:  None
  22. ; SPECIAL NOTES: This is a NEAR procedure needed by FPIN.
  23. ;
  24. ; ROUTINE TO PLACE DIGIT IN TEMP FLOATING POINT 
  25. ;
  26. fpindigt    proc    near
  27. ;
  28. ; clear the number first
  29.     push    di        ; save pointer
  30.     push    ax        ; save digit
  31.     mov    al,0        ; zero byte
  32.     mov    cx,13        ; do 13 bytes
  33. ;
  34. fpindigt1:
  35.     mov    [di],al        ; clear the byte
  36.     inc    di        ; point to next byte
  37.     loop    fpindigt1    ; loop for more
  38.     pop    ax        ; restore digit
  39.     pop    di        ; restore pointer
  40. ;
  41. ; move the digit into place
  42.     mov    [di+9],al    ; place the digit
  43. ;
  44.     ret            ; out of subr return
  45. ;
  46. fpindigt    endp
  47. ;-------------------------fpindigt routine ends---------------------------+
  48.